package com.elai.operate.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.elai.common.annotation.Excel;
import com.elai.common.core.domain.BaseEntity;
import com.elai.common.utils.DateUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 运营计划对象 operate_paln
 *
 * @author elai
 * @date 2021-03-23
 */
public class OperatePalnDO extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 计划ID */
    private Long id;

    /** 标题 */
    @Excel(name = "标题")
    private String title;

    /** 名称 */
    @Excel(name = "名称")
    private String name;

    /** 内容 */
    @Excel(name = "内容")
    private String content;

    /** 状态 */
    @Excel(name = "状态")
    private String status;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
    private Date beginDate;

    /** 接收时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "接收时间", width = 30, dateFormat = "yyyy-MM-dd  HH:mm:ss")
    private Date endDate;

    /** 类型 */
    @Excel(name = "类型")
    private String type;

    /** 通道 */
    @Excel(name = "通道")
    private String channel;

    /** 触发类型 01单词 02 重复 */
    @Excel(name = "触发类型 1单次 2 重复")
    private String touchType;

    /** 触发时间类型 01 每天 02 周 03月 */
    @Excel(name = "触发时间类型 01 每天 02 周 03月")
    private String touchDateType;

    /** 触发时间类型值 touch_date_type 02 存周  touch_date_type 03 存 天 */
    @Excel(name = "触发时间类型值 touch_date_type 02 存周  touch_date_type 03 存 天")
    private String touchDateValue;

    /** 触发日期 */
    @Excel(name = "触发日期")
    private String touchDate;

    /** 触发时间 */
    @Excel(name = "触发时间")
    private String touchTime;


    /** 触发时间表达式 */
    private String cronExpression;

    /** 参与限制 */
    @Excel(name = "参与限制")
    private String partLimit;



    /** 多少天 */
    private int partLimitDays;

    /** 多少次 */
    private int partLimitTimes;

    /** 人群类型 */
    @Excel(name = "人群类型")
    private String personType;

    /** 人群标签 */
    @Excel(name = "人群标签")
    private String personTags;

    /** 完成转换时间 */
    @Excel(name = "完成转换时间")
    private Long translateTime;

    /** 时间类型 */
    @Excel(name = "时间类型")
    private String translateType;

    /** 规则 */
    @Excel(name = "规则")
    private String ruleContent;

    /** 最近一次 */
    @Excel(name = "最近一次")
    private String latest;

    /** 完成率 */
    @Excel(name = "完成率")
    private BigDecimal completePercent;

    /** 整体完成率 */
    @Excel(name = "整体完成率")
    private BigDecimal allPercent;

    /** 营销类型 01 精准营销 02 福利 03 推送 */
    @Excel(name = "营销类型 01 精准营销 02 福利 03 推送")
    private String operateType;

    /** 第一步json内容 */
    @Excel(name = "第一步json内容")
    private String step1Json;

    /** 第二部json内容 */
    @Excel(name = "第二部json内容")
    private String step2Json;

    /** 第三步json内容 */
    @Excel(name = "第三步json内容")
    private String step3Json;

    private String[] dateRange;

    public String[] getDateRange() {
        return dateRange;
    }

    public void setDateRange(String[] dateRange) {
        this.dateRange = dateRange;
        if(this.dateRange.length>0)
            this.beginDate= DateUtils.parseDate(this.dateRange[0]);
        if(this.dateRange.length>1)
            this.endDate= DateUtils.parseDate(this.dateRange[1]);
    }



    public String getCronExpression() {
        return cronExpression;
    }

    public void setCronExpression(String cronExpression) {
        this.cronExpression = cronExpression;
    }

    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }

    public void setTitle(String title)
    {
        this.title = title;
    }
    public String getTitle()
    {
        return title;
    }

    public void setName(String name)
    {
        this.name = name;
    }
    public String getName()
    {
        return name;
    }

    public void setContent(String content)
    {
        this.content = content;
    }
    public String getContent()
    {
        return content;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }
    public String getStatus()
    {
        return status;
    }

    public void setBeginDate(Date beginDate)
    {
        this.beginDate = beginDate;
    }
    public Date getBeginDate()
    {
        return beginDate;
    }

    public void setEndDate(Date endDate)
    {
        this.endDate = endDate;
    }
    public Date getEndDate()
    {
        return endDate;
    }

    public void setType(String type)
    {
        this.type = type;
    }
    public String getType()
    {
        return type;
    }

    public void setChannel(String channel)
    {
        this.channel = channel;
    }
    public String getChannel()
    {
        return channel;
    }

    public void setTouchType(String touchType)
    {
        this.touchType = touchType;
    }
    public String getTouchType()
    {
        return touchType;
    }

    public void setTouchDateType(String touchDateType)
    {
        this.touchDateType = touchDateType;
    }
    public String getTouchDateType()
    {
        return touchDateType;
    }

    public void setTouchDateValue(String touchDateValue)
    {
        this.touchDateValue = touchDateValue;
    }
    public String getTouchDateValue()
    {
        return touchDateValue;
    }

    public void setTouchDate(String touchDate)
    {
        this.touchDate = touchDate;
    }
    public String getTouchDate()
    {
        return touchDate;
    }

    public void setTouchTime(String touchTime)
    {
        this.touchTime = touchTime;
    }
    public String getTouchTime()
    {
        return touchTime;
    }

    public void setPartLimit(String partLimit)
    {
        this.partLimit = partLimit;
    }
    public String getPartLimit()
    {
        return partLimit;
    }

    public int getPartLimitDays() {
        return partLimitDays;
    }

    public void setPartLimitDays(int partLimitDays) {
        this.partLimitDays = partLimitDays;
    }

    public int getPartLimitTimes() {
        return partLimitTimes;
    }

    public void setPartLimitTimes(int partLimitTimes) {
        this.partLimitTimes = partLimitTimes;
    }

    public void setPersonType(String personType)
    {
        this.personType = personType;
    }
    public String getPersonType()
    {
        return personType;
    }

    public void setPersonTags(String personTags)
    {
        this.personTags = personTags;
    }
    public String getPersonTags()
    {
        return personTags;
    }

    public void setTranslateTime(Long translateTime)
    {
        this.translateTime = translateTime;
    }
    public Long getTranslateTime()
    {
        return translateTime;
    }

    public void setTranslateType(String translateType)
    {
        this.translateType = translateType;
    }
    public String getTranslateType()
    {
        return translateType;
    }

    public void setRuleContent(String ruleContent)
    {
        this.ruleContent = ruleContent;
    }
    public String getRuleContent()
    {
        return ruleContent;
    }

    public void setLatest(String latest)
    {
        this.latest = latest;
    }
    public String getLatest()
    {
        return latest;
    }

    public void setCompletePercent(BigDecimal completePercent)
    {
        this.completePercent = completePercent;
    }
    public BigDecimal getCompletePercent()
    {
        return completePercent;
    }

    public void setAllPercent(BigDecimal allPercent)
    {
        this.allPercent = allPercent;
    }
    public BigDecimal getAllPercent()
    {
        return allPercent;
    }

    public void setOperateType(String operateType)
    {
        this.operateType = operateType;
    }
    public String getOperateType()
    {
        return operateType;
    }

    public void setStep1Json(String step1Json)
    {
        this.step1Json = step1Json;
    }
    public String getStep1Json()
    {
        return step1Json;
    }

    public void setStep2Json(String step2Json)
    {
        this.step2Json = step2Json;
    }
    public String getStep2Json()
    {
        return step2Json;
    }

    public void setStep3Json(String step3Json)
    {
        this.step3Json = step3Json;
    }
    public String getStep3Json()
    {
        return step3Json;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("title", getTitle())
            .append("name", getName())
            .append("content", getContent())
            .append("status", getStatus())
            .append("beginDate", getBeginDate())
            .append("endDate", getEndDate())
            .append("type", getType())
            .append("channel", getChannel())
            .append("touchType", getTouchType())
            .append("touchDateType", getTouchDateType())
            .append("touchDateValue", getTouchDateValue())
            .append("touchDate", getTouchDate())
            .append("touchTime", getTouchTime())
            .append("partLimit", getPartLimit())
            .append("personType", getPersonType())
            .append("personTags", getPersonTags())
            .append("translateTime", getTranslateTime())
            .append("translateType", getTranslateType())
            .append("ruleContent", getRuleContent())
            .append("latest", getLatest())
            .append("completePercent", getCompletePercent())
            .append("allPercent", getAllPercent())
            .append("operateType", getOperateType())
            .append("step1Json", getStep1Json())
            .append("step2Json", getStep2Json())
            .append("step3Json", getStep3Json())
            .toString();
    }
}
